package com.victor.common.node;

import com.victor.common.constant.Magic;

/**
 * jquery ztree 插件的节点
 */
public class ZTreeNode {
    /**
     * 节点id
     */
    private String id;
    /**
     * 父节点id
     */
    private Integer pId;
    /**
     * 节点名称
     */
    private String name;
    /**
     * 是否打开节点
     */
    private Boolean open;
    /**
     * 是否被选中
     */
    private Boolean checked;

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public Integer getpId() {
        return pId;
    }

    public void setpId(Integer pId) {
        this.pId = pId;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public Boolean getOpen() {
        return open;
    }

    public void setOpen(Boolean open) {
        this.open = open;
    }

    public Boolean getIsOpen() {
        return open;
    }

    public void setIsOpen(Boolean open) {
        this.open = open;
    }

    public Boolean getChecked() {
        return checked;
    }

    public void setChecked(Boolean checked) {
        this.checked = checked;
    }

    /**
     * <b>Description:创建顶级节点</b><br>
     *
     * @return
     * @Note <b>Author:</b>zhaojiabin</a>
     * <br><b>Date:</b> 2017年10月18日 上午10:03:36
     * <br><b>Version:</b> 1.0
     */
    public static ZTreeNode createParent() {
        ZTreeNode zTreeNode = new ZTreeNode();
        zTreeNode.setChecked(true);
        zTreeNode.setId("0");
        zTreeNode.setName(Magic.TOP_LEVEL);
        zTreeNode.setOpen(true);
        zTreeNode.setpId(0);
        return zTreeNode;
    }
}
